//#warning Upgrade NOTE: unity_Scale shader variable was removed; replaced 'unity_Scale.w' with '1.0'

// Upgrade NOTE: commented out 'float4x4 _Object2World', a built-in variable
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'


Shader  "NewWaterFlow" {

	Properties
	 {
 _MainTex ("Base (RGB)", 2D) = "white" {}
 _Scroll ("Offset", Float) = 0
 _Scale ("_Scale", Float) = 0.25
 _ScrollU ("OffsetU", Float) = 0
 _ScaleU ("_ScaleU", Float) = 1
}

	

	SubShader
     {
  Name "PREPASS"
  Tags { "LIGHTMODE"="PrePassBase" "QUEUE"="Transparent-1" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
  Cull Off
  Fog { Mode Off }
  Blend SrcAlpha OneMinusSrcAlpha

    LOD 100
	Pass
	{
	
	

	CGPROGRAM
	#pragma vertex vert
	#pragma fragment frag
	#include "UnityCG.cginc"
    //#define Fixed3(value)  fixed3(value, value,value)
	//#define Fixed4(value)  fixed4(value, value,value,value)

	struct VertexInput {
    fixed4 vertex : POSITION;
	fixed2 xlv_TEXCOORD0 : TEXCOORD0;
    //fixed2 xlv_TEXCOORD1 : TEXCOORD1;
    //fixed3 xlv_TEXCOORD2 : TEXCOORD2;
    //fixed3 xlv_TEXCOORD3 : TEXCOORD3;
    //fixed4 tangent : TANGENT;
    fixed3 normal : NORMAL;
    //fixed4 xlv_COLOR : COLOR;
	//VertexInput
	};


	struct VertexOutput {
	fixed4 pos : SV_POSITION;
    UNITY_FOG_COORDS(1)
    //fixed4 xlv_COLOR : COLOR;
	fixed2 xlv_TEXCOORD0 : TEXCOORD0;
    fixed3 xlv_TEXCOORD1 : TEXCOORD1;
    //fixed3 xlv_TEXCOORD2 : TEXCOORD2;
    //fixed3 xlv_TEXCOORD3 : TEXCOORD3;
    //fixed3 xlv_TEXCOORD4 : TEXCOORD4;
	//VertexOutput
	};

	

 
 
 
 
 // float4x4 _Object2World;

 float4 _MainTex_ST;


	

 sampler2D _MainTex;
 float _Scroll;
 float _Scale;
 float _ScrollU;
 float _ScaleU;




	VertexOutput vert (VertexInput v)
	{
	VertexOutput o;
	//o.pos = UnityObjectToClipPos (v.vertex);
	//o.xlv_TEXCOORD0 = TRANSFORM_TEX(v.xlv_TEXCOORD0, _MainTex);
	
  fixed3 tmpvar_1;
  float3x3 tmpvar_2;
  tmpvar_2[0] = unity_ObjectToWorld[0].xyz;
  tmpvar_2[1] = unity_ObjectToWorld[1].xyz;
  tmpvar_2[2] = unity_ObjectToWorld[2].xyz;
  float3 tmpvar_3;
  tmpvar_3 = mul(tmpvar_2 , (normalize(v.normal) * 1.0));
  tmpvar_1 = tmpvar_3;
  o.pos = UnityObjectToClipPos( v.vertex);
  o.xlv_TEXCOORD0 = ((v.xlv_TEXCOORD0 * _MainTex_ST.xy) + _MainTex_ST.zw);
  o.xlv_TEXCOORD1 = tmpvar_1;


    UNITY_TRANSFER_FOG(o,o.vertex);
   
	return o;
	}


	fixed4 frag(VertexOutput i) : SV_Target
    {
    //fixed4 tmpvar_2 = tex2D(_MainTex, i.uv);
	
  fixed4 res_1;
  half4 c_2;
  float2 uv_3;
  uv_3.y = (i.xlv_TEXCOORD0.y * _Scale);
  uv_3.x = (i.xlv_TEXCOORD0.x * _ScaleU);
  uv_3.x = (uv_3.x + _ScrollU);
  uv_3.y = (uv_3.y + _Scroll);
  fixed4 tmpvar_4;
  tmpvar_4 = tex2D (_MainTex, uv_3);
	UNITY_APPLY_FOG(i.fogCoord, tmpvar_4);
  c_2 = tmpvar_4;
  if ((c_2.w < 0.1)) {
    discard;
  };
  res_1.xyz = ((i.xlv_TEXCOORD1 * 0.5) + 0.5);
  res_1.w = 0.0;
   return res_1;
	}
	ENDCG
	}
  }
Fallback "Diffuse"
}

